package com.springdemo.jpa;

import com.springdemo.bean.Book;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;


public interface BookMapper extends JpaRepository<Book, Integer>,
        JpaSpecificationExecutor<Book> {

    Book findByBookId(int bookId);

    @Query(value = "select o from Book o where o.bookName =:bookName")
    Book findBookByName(@Param("bookName") String bookName);

}
